﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

public partial class AdminPages_AdminHome : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btn_SetMovieOfTheWeek_Click(object sender, EventArgs e)
    {
        DVDTableAdapters.MovieTableAdapter ta = new DVDTableAdapters.MovieTableAdapter();
        DataTable dt = ta.GetMovieOfTheWeek();
        try
        {
            DataRow row = dt.Rows[0];
            ta.UpdateMovieOfTheWeek(false, Convert.ToInt32(row["MovieID"]));
        }
        catch { }
        ta.UpdateMovieOfTheWeek(true, Convert.ToInt32(ddl_Movie.SelectedValue));
        Response.Redirect("~/DVDWeek.aspx");
    }
}